home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / doc / clippings / 920218-01 < prev    next >
Encoding:
Internet Message Format  |  1992-03-20  |  1.5 KB

  1. From: claude@genethon.fr (Claude Scarpelli)
  2. Newsgroups: alt.security
  3. Subject: lpr security problem (getlogin(3) is a security violation?)
  4. Message-ID: <1992Feb18.122952@genethon.fr>
  5. Date: 18 Feb 92 11:29:52 GMT
  6. Organization: Genethon -- CEPHB Human Polymorphism Study Center, Paris, France
  7.  
  8.  
  9.  
  10. I have discovered a strange behavior in /usr/ucb/lpr, which appears to
  11. be potentially dangerous. The problem I'll describe occurs on a Sun
  12. 4/470, SunOS 4.1 PSR_A with the Sun 100305-06 patch (lpd security
  13. bug).
  14.  
  15. /usr/ucb/lpr uses /etc/utmp to get the username. First, /etc/utmp is
  16. world writable on a Sun (This has been discuss several times, and
  17. doesn't matter for this problem).
  18.  
  19. Second: in our site, we heavily use xterm, and this one doesn't remove
  20. its utmp entry each time xterm ends. If a new user logs in the system
  21. with xterm -utmp (which causes xterm not to create a utmp entry), it
  22. may take the previous utmp entry for the pseudo terminal. At this time,
  23. "who am i" returns the wrong username. So, if this user uses lpr (or
  24. lpq, lprm) he becomes the old user, and then can remove his print jobs
  25. (and potentially his files with lpr -r, but I haven't tested it yet)
  26.  
  27.  
  28. The real problem is that lpr doesn't get the username with getuid(2),
  29. but with something like getlogin(3). I think all the programs which use
  30. getlogin(3) can't be "secure".
  31.  
  32. What's your opinion ?
  33.  
  34. -- 
  35. ------------------------------------------------------------------------------
  36. Claude Scarpelli                        Internet : claude@genethon.fr
  37. Human Polymorphism Study Center         or       : claude@cephb.fr
  38.  
  39.